from app import db

class Volume(db.Model):
    name = db.Column(db.String(128), primary_key=True)
    driver = db.Column(db.String(64), nullable=False)
    mountpoint = db.Column(db.String(256), nullable=False)

    def to_dict(self):
        return {
            "name": self.name,
            "driver": self.driver,
            "mountpoint": self.mountpoint
        }